/**
 * 
 * @Title: 附件类型
 * @Description: 
 * @author jugui
 * @date 2018年4月21日 09:05:45
 */

package com.ruoyi.finance.enums;

public enum AttachmentTypeEnum {
    FCZ("房产证", 1),
    SFHT("收房合同", 2),
    YZSFZ("业主身份证", 3),
    DLRSFZ("代理人身份证", 4),
    YHKXX("银行卡信息", 5),
    WTS("委托书", 6),
    JYHT("解约合同", 7),
    ZLHT("租赁合同", 8),
    KHSFZ("客户身份证", 9),
    WYJGD("物业交割单", 10),
    QT("其他", 99);		
    private String name;
    private int index;

    private AttachmentTypeEnum(String name, int index) {
        this.name = name;
        this.index = index;
    }

    // 普通方法
    public static String getName(int index) {
        for (AttachmentTypeEnum c : AttachmentTypeEnum.values()) {
            if (c.getIndex() == index) {
                return c.name;
            }
        }
        return null;
    }

    public static Integer getIndex(String name) {
        for (AttachmentTypeEnum c : AttachmentTypeEnum.values()) {
            if (c.getName().equals(name)) {
                return c.getIndex();
            }
        }
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }
}
